#include <bits/stdc++.h>
// 2025/03/08
// tag: 
// Author: Forever
using namespace std;

using int64 = int64_t;

int n, k, dp[100001], coin[11];
unordered_set<int> coins;

void init(){
    queue<int> q;
    for (int i = 1; i <= n; i++) 
        q.push(coin[i]);
    while (!q.empty()) {
        int len = q.size();
        for (int i = 1; i <= len; i++) {
            int x = q.front();
            q.pop();
            for (int j = 1; j <= n; j++) {
                int y = x * coin[j];
                if (coins.count(y) || y > k) continue;
                coins.insert(y);
                q.push(y);
            }
        }
    }
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n >> k;
    for (int i = 1; i <= n; i++) 
        cin >> coin[i], coins.insert(coin[i]);
    init();
    memset(dp, 0x3f, sizeof(dp));
    for (int x : coins)
        dp[x] = 1;
    for (int i : coins)
        for (int j = i; j <= k; j++)
            dp[j] = min(dp[j], dp[j - i] + 1);
    cout << dp[k] << endl;
    return 0;
}